#pragma once
#ifndef GNSYSTEM_H
#define GNSYSTEM_H

#include "GnOS.h"
#include "GnSystemDefine.h"
#include "GnMemoryDefine.h"
#include "GnMemoryManager.h"
#include "GnMemoryObject.h"
#include "GnBitwiseoperation.h"
#include "GnLog.h"
#include "GnTHelper.h"
#include <list>
#include <vector>
#include <map>

// Wrappers for some C Runtime functions
// Functions defined inline, so no need for NISYSTEM_ENTRY
//#define GnStrcat
//#define GnStrtok
//#define GnSprintf
//#define GnVsprintf
//#define GnSnprintf
//#define GnVsnprintf
//#define GnMemcpy
//#define GnMemcpy
//#define GnMemmove


//char* GnStrcpy(char* pcDest, gsize stDestSize, const char* pcSrc);
//char* GnStrncpy(char* pcDest, gsize stDestSize, const char* pcSrc,
//				gsize stCount);
//char* GnStrcat(char* pcDest, gsize stDestSize, const char* pcSrc);
//char* GnStrtok(char* pcString, const char* pcDelimit, char** ppcContext);
//int GnSprintf(char* pcDest, gsize stDestSize, const char* pcFormat, ...);
//int GnVsprintf(char* pcDest, gsize stDestSize, const char* pcFormat,
//			   va_list kArgs);
//int GnSnprintf(char* pcDest, gsize stDestSize, gsize stCount,
//			   const char* pcFormat, ...);
//int GnVsnprintf(char* pcDest, gsize stDestSize, gsize stCount,
//				const char* pcFormat, va_list kArgs);
//int GnMemcpy(void* pvDest, gsize stDestSize, const void* pvSrc,
//			 gsize stCount);
//int GnMemcpy(void* pvDest, const void* pvSrc, gsize stCount);
//int GnMemmove(void* pvDest, gsize stDestSize, const void* pvSrc,
//			  gsize stCount);
#define GnMax(a,b)  (((a) > (b)) ? (a) : (b))
#define GnMin(a,b)  (((a) < (b)) ? (a) : (b))

GNSYSTEM_ENTRY float GnGetCurrentTimeInSec();
GNSYSTEM_ENTRY unsigned int GnGetFileSize (const char* pFilename);

#ifdef GNDEBUG
GNSYSTEM_ENTRY void GnWriteToStdErr(const gchar* pText);
#else // #ifdef GNDEBUG
#define GnWriteToStdErr(x) ((void)0)
#endif // #ifdef GNDEBUG

#include "GnSystem.inl"
#endif // GNSYSTEM_H
